package com.ncloud.workflow.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;

import com.ncloud.workflow.entity.Commpara;

@MapperScan
public interface CommparaMapper{

	@Select("select * from sys_commpara where subsys_code = #{subsysCode} and param_attr = #{paramAttr} and param_code = #{paramCode}"
			+ " and (para_code1 = #{paraCode1} or #{paraCode1} is null )" + " and (para_code2 = #{paraCode2} or #{paraCode2} is null )"
			+ " and (para_code3 = #{paraCode3} or #{paraCode3} is null )" + " and (para_code4 = #{paraCode4} or #{paraCode4} is null )"
			+ " and use_tag = '1'")
	@Results({ @Result(column = "subsys_code", property = "subsysCode"), @Result(column = "param_attr", property = "paramAttr"),  
        @Result(column = "param_code", property = "paramCode"),@Result(column = "para_code1", property = "paraCode1"),
        @Result(column="para_code2",property="paraCode2"),@Result(column="para_code3",property="paraCode3"),
        @Result(column="para_code4",property="paraCode4"),@Result(column="para_code5",property="paraCode5"),
        @Result(column="para_code6",property="paraCode6"),@Result(column="para_code7",property="paraCode7"),
        @Result(column="para_code8",property="paraCode8"),@Result(column="para_code9",property="paraCode9"),
        @Result(column="para_code10",property="paraCode10"),@Result(column="para_code11",property="paraCode11"),
        @Result(column="para_code12",property="paraCode12"),@Result(column="para_code13",property="paraCode13"),
        @Result(column="para_code14",property="paraCode14"),@Result(column="para_code15",property="paraCode15"),
        @Result(column="use_tag",property="useTag"),@Result(column="remark",property="remark"),
        @Result(column="update_time",property="updateTime"),@Result(column="update_staff_id",property="updateStaffId")})
	List<Commpara> getInfoByParam(@Param("subsysCode") String subsysCode, @Param("paramAttr") String paramAttr,
                                  @Param("paramCode") String paramCode, @Param("paraCode1") String paraCode1,
                                  @Param("paraCode2") String paraCode2, @Param("paraCode3") String paraCode3,
                                  @Param("paraCode4") String paraCode4);
	
}
